/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sayang;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

/**
 *
 * @author Abahe
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        String requestParameters = "xxx"; // coba "" diganti dgn "kartika" atau apalah :D
        String result;
        
        try {
// Send data
            String urlStr = "http://biller.aryajayaformasi.com/index.php/home/masuk";
            if (requestParameters != null && requestParameters.length() > 0) {
                urlStr += "?" + "userid=naon@welah.com&pswd=ZTEwYWRjMzk0OWJhNTlhYmJlNTZlMDU3ZjIwZjg4M2U=";
            }
            URL url = new URL(urlStr);
            URLConnection conn = url.openConnection();

// Get the response
            BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            StringBuffer sb = new StringBuffer();
            String line;
            while ((line = rd.readLine()) != null) {
                sb.append(line);
            }
            rd.close();
            result = sb.toString();
            System.out.println("GET Response message = " + result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
